/**
 * @author wn
 * @date 2023/03/14 16:59:41
 * @description: table 的数据请求接口
 */

import request from '@/utils/request'

/**
 * 获取工艺流程 表一数据
 * @param
 * @returns Promise
 *  /queryOrdDataPerPage?json_data=%7B"companyID":66,"userID":266,"dataType":"PROCESS_FLOW"%7D
 * {column: "created_date", order: "desc", field: "ord_id", pageNo: 1, pageSize: 10}
 */

export const loadOrderData = parameter =>
	request(
		'/queryOrdDataPerPage?json_data=%7B"companyID":66,"userID":266,"dataType":"PROCESS_FLOW"%7D',
		parameter
	)

/**
 * 获取工艺流程 子表数据
 * @param obj -- 更改 mainDataID 为 selectedRowKeys
 * @returns Promise
 * /queryOrdDataPerPage?json_data=%7B"companyID":66,"userID":266,"dataType":"PROCESS_FLOW_LINE","dataID":2393127%7D
 *
 { column: "created_date"
   field: "ord_id,int06,rref05_no,rref05,rref05_name,c08,rref03_no,rref03,rref03_name,c03,action"
   mainDataID: "2393106"
   order: "desc"
   pageNo: "1"
   pageSize: "50"
}
 */

export const selectSubListData = (key, parameter) =>
	request(
		`/queryOrdDataPerPage?json_data=%7B"companyID":66,"userID":266,"dataType":"PROCESS_FLOW_LINE","dataID":${key}%7D`,
		parameter
	)
